<?php

// $Id$

require_once($WSC->get_site_inc_dir().'modules/admin_panel/site_admin_page_w_grid_ua.class.php');
require_once($WSC->get_site_inc_dir().'modules/admin_panel/grids/user_log/user_log_grid_ctrl.class.php');

require_once($WSC->get_site_inc_dir().'modules/user_auth_basic/classes/user_dbc.class.php');


class User_Log_WP extends Site_Admin_Page_W_Grid_UA {
	 protected function create_grid_ctrl() {
		$context = $this->get__context();

		if ($context->exists_in_get('user')) {
			$user_id = $context->get_from_get('user');

			$dbc = $this->get_dbc();
			$user = new User_DBC();
			if ($user->load_by_id($dbc, $user_id)) {
				$this->export('username', $user->get_username());
				$this->export('user_id', $user_id);
			}
		} else {
			throw new Tangra_User_Exception('Expecting "user" parameter.');
		}

		$tvm = $this->get_tvm();

		$ret = new User_Log_Grid_Ctrl('user_log', $tvm, Tangra_Parameter_Method::GET, $user_id);

		return $ret;
	 }
}
